home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 November / PCWNOV07.iso / Software / Freeware / NSIS 2.29 / nsis-2.29-setup.exe / Include / TextFunc.nsh < prev    next >
Encoding:
Text File  |  2007-02-17  |  27.4 KB  |  1,505 lines

  1. /*
  2. _____________________________________________________________________________
  3.  
  4.                        Text Functions Header v2.4
  5. _____________________________________________________________________________
  6.  
  7.  2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
  8.  
  9.  See documentation for more information about the following functions.
  10.  
  11.  Usage in script:
  12.  1. !include "TextFunc.nsh"
  13.  2. !insertmacro TextFunction
  14.  3. [Section|Function]
  15.       ${TextFunction} "File" "..."  $var
  16.     [SectionEnd|FunctionEnd]
  17.  
  18.  
  19.  TextFunction=[LineFind|LineRead|FileReadFromEnd|LineSum|FileJoin|
  20.                TextCompare|TextCompareS|ConfigRead|ConfigReadS|
  21.                ConfigWrite|ConfigWriteS|FileRecode|TrimNewLines]
  22.  
  23.  un.TextFunction=[un.LineFind|un.LineRead|un.FileReadFromEnd|un.LineSum|
  24.                   un.FileJoin|un.TextCompare|un.TextCompareS|un.ConfigRead|
  25.                   un.ConfigReadS|un.ConfigWrite|un.ConfigWriteS|un.FileRecode|
  26.                   un.TrimNewLines]
  27.  
  28. _____________________________________________________________________________
  29.  
  30.                        Thanks to:
  31. _____________________________________________________________________________
  32.  
  33. LineRead
  34.     Afrow UK (Based on his idea of Function "ReadFileLine")
  35. LineSum
  36.     Afrow UK (Based on his idea of Function "LineCount")
  37. FileJoin
  38.     Afrow UK (Based on his idea of Function "JoinFiles")
  39. ConfigRead
  40.     vbgunz (His idea)
  41. ConfigWrite
  42.     vbgunz (His idea)
  43. TrimNewLines
  44.     sunjammer (Based on his Function "TrimNewLines")
  45. */
  46.  
  47.  
  48. ;_____________________________________________________________________________
  49. ;
  50. ;                                   Macros
  51. ;_____________________________________________________________________________
  52. ;
  53. ; Change log window verbosity (default: 3=no script)
  54. ;
  55. ; Example:
  56. ; !include "TextFunc.nsh"
  57. ; !insertmacro LineFind
  58. ; ${TEXTFUNC_VERBOSE} 4   # all verbosity
  59. ; !insertmacro LineSum
  60. ; ${TEXTFUNC_VERBOSE} 3   # no script
  61.  
  62. !ifndef TEXTFUNC_INCLUDED
  63. !define TEXTFUNC_INCLUDED
  64.  
  65. !include FileFunc.nsh
  66.  
  67. !verbose push
  68. !verbose 3
  69. !ifndef _TEXTFUNC_VERBOSE
  70.     !define _TEXTFUNC_VERBOSE 3
  71. !endif
  72. !verbose ${_TEXTFUNC_VERBOSE}
  73. !define TEXTFUNC_VERBOSE `!insertmacro TEXTFUNC_VERBOSE`
  74. !define _TEXTFUNC_UN
  75. !define _TEXTFUNC_S
  76. !verbose pop
  77.  
  78. !macro TEXTFUNC_VERBOSE _VERBOSE
  79.     !verbose push
  80.     !verbose 3
  81.     !undef _TEXTFUNC_VERBOSE
  82.     !define _TEXTFUNC_VERBOSE ${_VERBOSE}
  83.     !verbose pop
  84. !macroend
  85.  
  86.  
  87. # Install. Case insensitive. #
  88.  
  89. !macro LineFindCall _INPUT _OUTPUT _RANGE _FUNC
  90.     !verbose push
  91.     !verbose ${_TEXTFUNC_VERBOSE}
  92.     Push $0
  93.     Push `${_INPUT}`
  94.     Push `${_OUTPUT}`
  95.     Push `${_RANGE}`
  96.     GetFunctionAddress $0 `${_FUNC}`
  97.     Push `$0`
  98.     Call LineFind
  99.     Pop $0
  100.     !verbose pop
  101. !macroend
  102.  
  103. !macro LineReadCall _FILE _NUMBER _RESULT
  104.     !verbose push
  105.     !verbose ${_TEXTFUNC_VERBOSE}
  106.     Push `${_FILE}`
  107.     Push `${_NUMBER}`
  108.     Call LineRead
  109.     Pop ${_RESULT}
  110.     !verbose pop
  111. !macroend
  112.  
  113. !macro FileReadFromEndCall _FILE _FUNC
  114.     !verbose push
  115.     !verbose ${_TEXTFUNC_VERBOSE}
  116.     Push $0
  117.     Push `${_FILE}`
  118.     GetFunctionAddress $0 `${_FUNC}`
  119.     Push `$0`
  120.     Call FileReadFromEnd
  121.     Pop $0
  122.     !verbose pop
  123. !macroend
  124.  
  125. !macro LineSumCall _FILE _RESULT
  126.     !verbose push
  127.     !verbose ${_TEXTFUNC_VERBOSE}
  128.     Push `${_FILE}`
  129.     Call LineSum
  130.     Pop ${_RESULT}
  131.     !verbose pop
  132. !macroend
  133.  
  134. !macro FileJoinCall _FILE1 _FILE2 _FILE3
  135.     !verbose push
  136.     !verbose ${_TEXTFUNC_VERBOSE}
  137.     Push `${_FILE1}`
  138.     Push `${_FILE2}`
  139.     Push `${_FILE3}`
  140.     Call FileJoin
  141.     !verbose pop
  142. !macroend
  143.  
  144. !macro TextCompareCall _FILE1 _FILE2 _OPTION _FUNC
  145.     !verbose push
  146.     !verbose ${_TEXTFUNC_VERBOSE}
  147.     Push $0
  148.     Push `${_FILE1}`
  149.     Push `${_FILE2}`
  150.     Push `${_OPTION}`
  151.     GetFunctionAddress $0 `${_FUNC}`
  152.     Push `$0`
  153.     Call TextCompare
  154.     Pop $0
  155.     !verbose pop
  156. !macroend
  157.  
  158. !macro ConfigReadCall _FILE _ENTRY _RESULT
  159.     !verbose push
  160.     !verbose ${_TEXTFUNC_VERBOSE}
  161.     Push `${_FILE}`
  162.     Push `${_ENTRY}`
  163.     Call ConfigRead
  164.     Pop ${_RESULT}
  165.     !verbose pop
  166. !macroend
  167.  
  168. !macro ConfigWriteCall _FILE _ENTRY _VALUE _RESULT
  169.     !verbose push
  170.     !verbose ${_TEXTFUNC_VERBOSE}
  171.     Push `${_FILE}`
  172.     Push `${_ENTRY}`
  173.     Push `${_VALUE}`
  174.     Call ConfigWrite
  175.     Pop ${_RESULT}
  176.     !verbose pop
  177. !macroend
  178.  
  179. !macro FileRecodeCall _FILE _FORMAT
  180.     !verbose push
  181.     !verbose ${_TEXTFUNC_VERBOSE}
  182.     Push `${_FILE}`
  183.     Push `${_FORMAT}`
  184.     Call FileRecode
  185.     !verbose pop
  186. !macroend
  187.  
  188. !macro TrimNewLinesCall _FILE _RESULT
  189.     !verbose push
  190.     !verbose ${_TEXTFUNC_VERBOSE}
  191.     Push `${_FILE}`
  192.     Call TrimNewLines
  193.     Pop ${_RESULT}
  194.     !verbose pop
  195. !macroend
  196.  
  197. !macro _TextFunc_TempFileForFile _FILE _RESULT
  198.     ${${_TEXTFUNC_UN}GetParent} ${_FILE} ${_RESULT}
  199.     StrCmp ${_RESULT} "" 0 +2
  200.         StrCpy ${_RESULT} $EXEDIR
  201.     GetTempFileName ${_RESULT} ${_RESULT}
  202.     StrCmp ${_RESULT} "" 0 +2
  203.         GetTempFileName ${_RESULT}
  204.     ClearErrors
  205. !macroend
  206.  
  207. !macro LineFind
  208.     !ifndef ${_TEXTFUNC_UN}LineFind
  209.         !verbose push
  210.         !verbose ${_TEXTFUNC_VERBOSE}
  211.         !define ${_TEXTFUNC_UN}LineFind `!insertmacro ${_TEXTFUNC_UN}LineFindCall`
  212.  
  213.         !insertmacro ${_TEXTFUNC_UN}GetParent
  214.  
  215.         Function ${_TEXTFUNC_UN}LineFind
  216.             Exch $3
  217.             Exch
  218.             Exch $2
  219.             Exch
  220.             Exch 2
  221.             Exch $1
  222.             Exch 2
  223.             Exch 3
  224.             Exch $0
  225.             Exch 3
  226.             Push $4
  227.             Push $5
  228.             Push $6
  229.             Push $7
  230.             Push $8
  231.             Push $9
  232.             Push $R4
  233.             Push $R5
  234.             Push $R6
  235.             Push $R7
  236.             Push $R8
  237.             Push $R9
  238.             ClearErrors
  239.  
  240.             IfFileExists '$0' 0 error
  241.             StrCmp $1 '/NUL' begin
  242.             StrCpy $8 0
  243.             IntOp $8 $8 - 1
  244.             StrCpy $9 $1 1 $8
  245.             StrCmp $9 \ +2
  246.             StrCmp $9 '' +3 -3
  247.             StrCpy $9 $1 $8
  248.             IfFileExists '$9\*.*' 0 error
  249.  
  250.             begin:
  251.             StrCpy $4 1
  252.             StrCpy $5 -1
  253.             StrCpy $6 0
  254.             StrCpy $7 0
  255.             StrCpy $R4 ''
  256.             StrCpy $R6 ''
  257.             StrCpy $R7 ''
  258.             StrCpy $R8 0
  259.  
  260.             StrCpy $8 $2 1
  261.             StrCmp $8 '{' 0 delspaces
  262.             StrCpy $2 $2 '' 1
  263.             StrCpy $8 $2 1 -1
  264.             StrCmp $8 '}' 0 delspaces
  265.             StrCpy $2 $2 -1
  266.             StrCpy $R6 cut
  267.  
  268.             delspaces:
  269.             StrCpy $8 $2 1
  270.             StrCmp $8 ' ' 0 +3
  271.             StrCpy $2 $2 '' 1
  272.             goto -3
  273.             StrCmp $2$7 '0' file
  274.             StrCpy $4 ''
  275.             StrCpy $5 ''
  276.             StrCmp $2 '' writechk
  277.  
  278.             range:
  279.             StrCpy $8 0
  280.             StrCpy $9 $2 1 $8
  281.             StrCmp $9 '' +5
  282.             StrCmp $9 ' ' +4
  283.             StrCmp $9 ':' +3
  284.             IntOp $8 $8 + 1
  285.             goto -5
  286.             StrCpy $5 $2 $8
  287.             IntOp $5 $5 + 0
  288.             IntOp $8 $8 + 1
  289.             StrCpy $2 $2 '' $8
  290.             StrCmp $4 '' 0 +2
  291.             StrCpy $4 $5
  292.             StrCmp $9 ':' range
  293.  
  294.             IntCmp $4 0 0 +2
  295.             IntCmp $5 -1 goto 0 growthcmp
  296.             StrCmp $R7 '' 0 minus2plus
  297.             StrCpy $R7 0
  298.             FileOpen $8 $0 r
  299.             FileRead $8 $9
  300.             IfErrors +3
  301.             IntOp $R7 $R7 + 1
  302.             Goto -3
  303.             FileClose $8
  304.  
  305.             minus2plus:
  306.             IntCmp $4 0 +5 0 +5
  307.             IntOp $4 $R7 + $4
  308.             IntOp $4 $4 + 1
  309.             IntCmp $4 0 +2 0 +2
  310.             StrCpy $4 0
  311.             IntCmp $5 -1 goto 0 growthcmp
  312.             IntOp $5 $R7 + $5
  313.             IntOp $5 $5 + 1
  314.             growthcmp:
  315.             IntCmp $4 $5 goto goto
  316.             StrCpy $5 $4
  317.             goto:
  318.             goto $7
  319.  
  320.             file:
  321.             StrCmp $1 '/NUL' notemp
  322.             !insertmacro _TextFunc_TempFileForFile $1 $R4
  323.             Push $R4
  324.             FileOpen $R4 $R4 w
  325.             notemp:
  326.             FileOpen $R5 $0 r
  327.             IfErrors preerror
  328.  
  329.             loop:
  330.             IntOp $R8 $R8 + 1
  331.             FileRead $R5 $R9
  332.             IfErrors handleclose
  333.  
  334.             cmp:
  335.             StrCmp $2$4$5 '' writechk
  336.             IntCmp $4 $R8 call 0 writechk
  337.             StrCmp $5 -1 call
  338.             IntCmp $5 $R8 call 0 call
  339.  
  340.             GetLabelAddress $7 cmp
  341.             goto delspaces
  342.  
  343.             call:
  344.             StrCpy $7 $R9
  345.             Push $0
  346.             Push $1
  347.             Push $2
  348.             Push $3
  349.             Push $4
  350.             Push $5
  351.             Push $6
  352.             Push $7
  353.             Push $R4
  354.             Push $R5
  355.             Push $R6
  356.             Push $R7
  357.             Push $R8
  358.             StrCpy $R6 '$4:$5'
  359.             StrCmp $R7 '' +3
  360.             IntOp $R7 $R8 - $R7
  361.             IntOp $R7 $R7 - 1
  362.             Call $3
  363.             Pop $9
  364.             Pop $R8
  365.             Pop $R7
  366.             Pop $R6
  367.             Pop $R5
  368.             Pop $R4
  369.             Pop $7
  370.             Pop $6
  371.             Pop $5
  372.             Pop $4
  373.             Pop $3
  374.             Pop $2
  375.             Pop $1
  376.             Pop $0
  377.             IfErrors preerror
  378.             StrCmp $9 'StopLineFind' 0 +3
  379.             IntOp $6 $6 + 1
  380.             goto handleclose
  381.             StrCmp $1 '/NUL' loop
  382.             StrCmp $9 'SkipWrite' 0 +3
  383.             IntOp $6 $6 + 1
  384.             goto loop
  385.             StrCmp $7 $R9 write
  386.             IntOp $6 $6 + 1
  387.             goto write
  388.  
  389.             writechk:
  390.             StrCmp $1 '/NUL' loop
  391.             StrCmp $R6 cut 0 write
  392.             IntOp $6 $6 + 1
  393.             goto loop
  394.  
  395.             write:
  396.             FileWrite $R4 $R9
  397.             goto loop
  398.  
  399.             preerror:
  400.             SetErrors
  401.  
  402.             handleclose:
  403.             StrCmp $1 '/NUL' +3
  404.             FileClose $R4
  405.             Pop $R4
  406.             FileClose $R5
  407.             IfErrors error
  408.  
  409.             StrCmp $1 '/NUL' end
  410.             StrCmp $1 '' 0 +2
  411.             StrCpy $1 $0
  412.             StrCmp $6 0 0 rename
  413.             FileOpen $7 $0 r
  414.             FileSeek $7 0 END $8
  415.             FileClose $7
  416.             FileOpen $7 $R4 r
  417.             FileSeek $7 0 END $9
  418.             FileClose $7
  419.             IntCmp $8 $9 0 rename
  420.             Delete $R4
  421.             StrCmp $1 $0 end
  422.             CopyFiles /SILENT $0 $1
  423.             goto end
  424.  
  425.             rename:
  426.             Delete '$EXEDIR\$1'
  427.             Rename $R4 '$EXEDIR\$1'
  428.             IfErrors 0 end
  429.             Delete $1
  430.             Rename $R4 $1
  431.             IfErrors 0 end
  432.  
  433.             error:
  434.             SetErrors
  435.  
  436.             end:
  437.             Pop $R9
  438.             Pop $R8
  439.             Pop $R7
  440.             Pop $R6
  441.             Pop $R5
  442.             Pop $R4
  443.             Pop $9
  444.             Pop $8
  445.             Pop $7
  446.             Pop $6
  447.             Pop $5
  448.             Pop $4
  449.             Pop $3
  450.             Pop $2
  451.             Pop $1
  452.             Pop $0
  453.         FunctionEnd
  454.  
  455.         !verbose pop
  456.     !endif
  457. !macroend
  458.  
  459. !macro LineRead
  460.     !ifndef ${_TEXTFUNC_UN}LineRead
  461.         !verbose push
  462.         !verbose ${_TEXTFUNC_VERBOSE}
  463.         !define ${_TEXTFUNC_UN}LineRead `!insertmacro ${_TEXTFUNC_UN}LineReadCall`
  464.  
  465.         Function ${_TEXTFUNC_UN}LineRead
  466.             Exch $1
  467.             Exch
  468.             Exch $0
  469.             Exch
  470.             Push $2
  471.             Push $3
  472.             Push $4
  473.             ClearErrors
  474.  
  475.             IfFileExists $0 0 error
  476.             IntOp $1 $1 + 0
  477.             IntCmp $1 0 error 0 plus
  478.             StrCpy $4 0
  479.             FileOpen $2 $0 r
  480.             IfErrors error
  481.             FileRead $2 $3
  482.             IfErrors +3
  483.             IntOp $4 $4 + 1
  484.             Goto -3
  485.             FileClose $2
  486.             IntOp $1 $4 + $1
  487.             IntOp $1 $1 + 1
  488.             IntCmp $1 0 error error
  489.  
  490.             plus:
  491.             FileOpen $2 $0 r
  492.             IfErrors error
  493.             StrCpy $3 0
  494.             IntOp $3 $3 + 1
  495.             FileRead $2 $0
  496.             IfErrors +4
  497.             StrCmp $3 $1 0 -3
  498.             FileClose $2
  499.             goto end
  500.             FileClose $2
  501.  
  502.             error:
  503.             SetErrors
  504.             StrCpy $0 ''
  505.  
  506.             end:
  507.             Pop $4
  508.             Pop $3
  509.             Pop $2
  510.             Pop $1
  511.             Exch $0
  512.         FunctionEnd
  513.  
  514.         !verbose pop
  515.     !endif
  516. !macroend
  517.  
  518. !macro FileReadFromEnd
  519.     !ifndef ${_TEXTFUNC_UN}FileReadFromEnd
  520.         !verbose push
  521.         !verbose ${_TEXTFUNC_VERBOSE}
  522.         !define ${_TEXTFUNC_UN}FileReadFromEnd `!insertmacro ${_TEXTFUNC_UN}FileReadFromEndCall`
  523.  
  524.         Function ${_TEXTFUNC_UN}FileReadFromEnd
  525.             Exch $1
  526.             Exch
  527.             Exch $0
  528.             Exch
  529.             Push $7
  530.             Push $8
  531.             Push $9
  532.             ClearErrors
  533.  
  534.             StrCpy $7 -1
  535.             StrCpy $8 0
  536.             IfFileExists $0 0 error
  537.             FileOpen $0 $0 r
  538.             IfErrors error
  539.             FileRead $0 $9
  540.             IfErrors +4
  541.             Push $9
  542.             IntOp $8 $8 + 1
  543.             goto -4
  544.             FileClose $0
  545.  
  546.             nextline:
  547.             StrCmp $8 0 end
  548.             Pop $9
  549.             Push $1
  550.             Push $7
  551.             Push $8
  552.             Call $1
  553.             Pop $0
  554.             Pop $8
  555.             Pop $7
  556.             Pop $1
  557.             IntOp $7 $7 - 1
  558.             IntOp $8 $8 - 1
  559.             IfErrors error
  560.             StrCmp $0 'StopFileReadFromEnd' clearstack nextline
  561.  
  562.             error:
  563.             SetErrors
  564.  
  565.             clearstack:
  566.             StrCmp $8 0 end
  567.             Pop $9
  568.             IntOp $8 $8 - 1
  569.             goto clearstack
  570.  
  571.             end:
  572.             Pop $9
  573.             Pop $8
  574.             Pop $7
  575.             Pop $1
  576.             Pop $0
  577.         FunctionEnd
  578.  
  579.         !verbose pop
  580.     !endif
  581. !macroend
  582.  
  583. !macro LineSum
  584.     !ifndef ${_TEXTFUNC_UN}LineSum
  585.         !verbose push
  586.         !verbose ${_TEXTFUNC_VERBOSE}
  587.         !define ${_TEXTFUNC_UN}LineSum `!insertmacro ${_TEXTFUNC_UN}LineSumCall`
  588.  
  589.         Function ${_TEXTFUNC_UN}LineSum
  590.             Exch $0
  591.             Push $1
  592.             Push $2
  593.             ClearErrors
  594.  
  595.             IfFileExists $0 0 error
  596.             StrCpy $2 0
  597.             FileOpen $0 $0 r
  598.             IfErrors error
  599.             FileRead $0 $1
  600.             IfErrors +3
  601.             IntOp $2 $2 + 1
  602.             Goto -3
  603.             FileClose $0
  604.             StrCpy $0 $2
  605.             goto end
  606.  
  607.             error:
  608.             SetErrors
  609.             StrCpy $0 ''
  610.  
  611.             end:
  612.             Pop $2
  613.             Pop $1
  614.             Exch $0
  615.         FunctionEnd
  616.  
  617.         !verbose pop
  618.     !endif
  619. !macroend
  620.  
  621. !macro FileJoin
  622.     !ifndef ${_TEXTFUNC_UN}FileJoin
  623.         !verbose push
  624.         !verbose ${_TEXTFUNC_VERBOSE}
  625.         !define ${_TEXTFUNC_UN}FileJoin `!insertmacro ${_TEXTFUNC_UN}FileJoinCall`
  626.  
  627.         !insertmacro ${_TEXTFUNC_UN}GetParent
  628.  
  629.         Function ${_TEXTFUNC_UN}FileJoin
  630.             Exch $2
  631.             Exch
  632.             Exch $1
  633.             Exch
  634.             Exch 2
  635.             Exch $0
  636.             Exch 2
  637.             Push $3
  638.             Push $4
  639.             Push $5
  640.             ClearErrors
  641.  
  642.             IfFileExists $0 0 error
  643.             IfFileExists $1 0 error
  644.             StrCpy $3 0
  645.             IntOp $3 $3 - 1
  646.             StrCpy $4 $2 1 $3
  647.             StrCmp $4 \ +2
  648.             StrCmp $4 '' +3 -3
  649.             StrCpy $4 $2 $3
  650.             IfFileExists '$4\*.*' 0 error
  651.  
  652.             StrCmp $2 $0 0 +2
  653.             StrCpy $2 ''
  654.             StrCmp $2 '' 0 +3
  655.             StrCpy $4 $0
  656.             Goto notemp
  657.             !insertmacro _TextFunc_TempFileForFile $2 $4
  658.             CopyFiles /SILENT $0 $4
  659.             notemp:
  660.             FileOpen $3 $4 a
  661.             IfErrors error
  662.             FileSeek $3 -1 END
  663.             FileRead $3 $5
  664.             StrCmp $5 '$\r' +3
  665.             StrCmp $5 '$\n' +2
  666.             FileWrite $3 '$\r$\n'
  667.  
  668.             ;FileWrite $3 '$\r$\n--Divider--$\r$\n'
  669.  
  670.             FileOpen $0 $1 r
  671.             IfErrors error
  672.             FileRead $0 $5
  673.             IfErrors +3
  674.             FileWrite $3 $5
  675.             goto -3
  676.             FileClose $0
  677.             FileClose $3
  678.             StrCmp $2 '' end
  679.             Delete '$EXEDIR\$2'
  680.             Rename $4 '$EXEDIR\$2'
  681.             IfErrors 0 end
  682.             Delete $2
  683.             Rename $4 $2
  684.             IfErrors 0 end
  685.  
  686.             error:
  687.             SetErrors
  688.  
  689.             end:
  690.             Pop $5
  691.             Pop $4
  692.             Pop $3
  693.             Pop $2
  694.             Pop $1
  695.             Pop $0
  696.         FunctionEnd
  697.  
  698.         !verbose pop
  699.     !endif
  700. !macroend
  701.  
  702. !macro TextCompare
  703.     !ifndef ${_TEXTFUNC_UN}TextCompare${_TEXTFUNC_S}
  704.         !verbose push
  705.         !verbose ${_TEXTFUNC_VERBOSE}
  706.         !define ${_TEXTFUNC_UN}TextCompare${_TEXTFUNC_S} `!insertmacro ${_TEXTFUNC_UN}TextCompare${_TEXTFUNC_S}Call`
  707.  
  708.         Function ${_TEXTFUNC_UN}TextCompare${_TEXTFUNC_S}
  709.             Exch $3
  710.             Exch
  711.             Exch $2
  712.             Exch
  713.             Exch 2
  714.             Exch $1
  715.             Exch 2
  716.             Exch 3
  717.             Exch $0
  718.             Exch 3
  719.             Push $4
  720.             Push $5
  721.             Push $6
  722.             Push $7
  723.             Push $8
  724.             Push $9
  725.             ClearErrors
  726.  
  727.             IfFileExists $0 0 error
  728.             IfFileExists $1 0 error
  729.             StrCmp $2 'FastDiff' +5
  730.             StrCmp $2 'FastEqual' +4
  731.             StrCmp $2 'SlowDiff' +3
  732.             StrCmp $2 'SlowEqual' +2
  733.             goto error
  734.  
  735.             FileOpen $4 $0 r
  736.             IfErrors error
  737.             FileOpen $5 $1 r
  738.             IfErrors error
  739.             SetDetailsPrint textonly
  740.  
  741.             StrCpy $6 0
  742.             StrCpy $8 0
  743.  
  744.             nextline:
  745.             StrCmp${_TEXTFUNC_S} $4 '' fast
  746.             IntOp $8 $8 + 1
  747.             FileRead $4 $9
  748.             IfErrors 0 +4
  749.             FileClose $4
  750.             StrCpy $4 ''
  751.             StrCmp${_TEXTFUNC_S} $5 '' end
  752.             StrCmp $2 'FastDiff' fast
  753.             StrCmp $2 'FastEqual' fast slow
  754.  
  755.             fast:
  756.             StrCmp${_TEXTFUNC_S} $5 '' call
  757.             IntOp $6 $6 + 1
  758.             FileRead $5 $7
  759.             IfErrors 0 +5
  760.             FileClose $5
  761.             StrCpy $5 ''
  762.             StrCmp${_TEXTFUNC_S} $4 '' end
  763.             StrCmp $2 'FastDiff' call close
  764.             StrCmp $2 'FastDiff' 0 +2
  765.             StrCmp${_TEXTFUNC_S} $7 $9 nextline call
  766.             StrCmp${_TEXTFUNC_S} $7 $9 call nextline
  767.  
  768.             slow:
  769.             StrCmp${_TEXTFUNC_S} $4 '' close
  770.             StrCpy $6 ''
  771.             DetailPrint '$8. $9'
  772.             FileSeek $5 0
  773.  
  774.             slownext:
  775.             FileRead $5 $7
  776.             IfErrors 0 +2
  777.             StrCmp $2 'SlowDiff' call nextline
  778.             StrCmp $2 'SlowDiff' 0 +2
  779.             StrCmp${_TEXTFUNC_S} $7 $9 nextline slownext
  780.             IntOp $6 $6 + 1
  781.             StrCmp${_TEXTFUNC_S} $7 $9 0 slownext
  782.  
  783.             call:
  784.             Push $2
  785.             Push $3
  786.             Push $4
  787.             Push $5
  788.             Push $6
  789.             Push $7
  790.             Push $8
  791.             Push $9
  792.             Call $3
  793.             Pop $0
  794.             Pop $9
  795.             Pop $8
  796.             Pop $7
  797.             Pop $6
  798.             Pop $5
  799.             Pop $4
  800.             Pop $3
  801.             Pop $2
  802.             StrCmp $0 'StopTextCompare' 0 nextline
  803.  
  804.             close:
  805.             FileClose $4
  806.             FileClose $5
  807.             goto end
  808.  
  809.             error:
  810.             SetErrors
  811.  
  812.             end:
  813.             SetDetailsPrint both
  814.             Pop $9
  815.             Pop $8
  816.             Pop $7
  817.             Pop $6
  818.             Pop $5
  819.             Pop $4
  820.             Pop $3
  821.             Pop $2
  822.             Pop $1
  823.             Pop $0
  824.         FunctionEnd
  825.  
  826.         !verbose pop
  827.     !endif
  828. !macroend
  829.  
  830. !macro ConfigRead
  831.     !ifndef ${_TEXTFUNC_UN}ConfigRead${_TEXTFUNC_S}
  832.         !verbose push
  833.         !verbose ${_TEXTFUNC_VERBOSE}
  834.         !define ${_TEXTFUNC_UN}ConfigRead${_TEXTFUNC_S} `!insertmacro ${_TEXTFUNC_UN}ConfigRead${_TEXTFUNC_S}Call`
  835.  
  836.         Function ${_TEXTFUNC_UN}ConfigRead${_TEXTFUNC_S}
  837.             Exch $1
  838.             Exch
  839.             Exch $0
  840.             Exch
  841.             Push $2
  842.             Push $3
  843.             Push $4
  844.             ClearErrors
  845.  
  846.             FileOpen $2 $0 r
  847.             IfErrors error
  848.             StrLen $0 $1
  849.             StrCmp${_TEXTFUNC_S} $0 0 error
  850.  
  851.             readnext:
  852.             FileRead $2 $3
  853.             IfErrors error
  854.             StrCpy $4 $3 $0
  855.             StrCmp${_TEXTFUNC_S} $4 $1 0 readnext
  856.             StrCpy $0 $3 '' $0
  857.             StrCpy $4 $0 1 -1
  858.             StrCmp${_TEXTFUNC_S} $4 '$\r' +2
  859.             StrCmp${_TEXTFUNC_S} $4 '$\n' 0 close
  860.             StrCpy $0 $0 -1
  861.             goto -4
  862.  
  863.             error:
  864.             SetErrors
  865.             StrCpy $0 ''
  866.  
  867.             close:
  868.             FileClose $2
  869.  
  870.             Pop $4
  871.             Pop $3
  872.             Pop $2
  873.             Pop $1
  874.             Exch $0
  875.         FunctionEnd
  876.  
  877.         !verbose pop
  878.     !endif
  879. !macroend
  880.  
  881. !macro ConfigWrite
  882.     !ifndef ${_TEXTFUNC_UN}ConfigWrite${_TEXTFUNC_S}
  883.         !verbose push
  884.         !verbose ${_TEXTFUNC_VERBOSE}
  885.         !define ${_TEXTFUNC_UN}ConfigWrite${_TEXTFUNC_S} `!insertmacro ${_TEXTFUNC_UN}ConfigWrite${_TEXTFUNC_S}Call`
  886.  
  887.         Function ${_TEXTFUNC_UN}ConfigWrite${_TEXTFUNC_S}
  888.             Exch $2
  889.             Exch
  890.             Exch $1
  891.             Exch
  892.             Exch 2
  893.             Exch $0
  894.             Exch 2
  895.             Push $3
  896.             Push $4
  897.             Push $5
  898.             Push $6
  899.             ClearErrors
  900.  
  901.             IfFileExists $0 0 error
  902.             FileOpen $3 $0 a
  903.             IfErrors error
  904.  
  905.             StrLen $0 $1
  906.             StrCmp${_TEXTFUNC_S} $0 0 0 readnext
  907.             StrCpy $0 ''
  908.             goto close
  909.  
  910.             readnext:
  911.             FileRead $3 $4
  912.             IfErrors add
  913.             StrCpy $5 $4 $0
  914.             StrCmp${_TEXTFUNC_S} $5 $1 0 readnext
  915.  
  916.             StrCpy $5 0
  917.             IntOp $5 $5 - 1
  918.             StrCpy $6 $4 1 $5
  919.             StrCmp${_TEXTFUNC_S} $6 '$\r' -2
  920.             StrCmp${_TEXTFUNC_S} $6 '$\n' -3
  921.             StrCpy $6 $4
  922.             StrCmp${_TEXTFUNC_S} $5 -1 +3
  923.             IntOp $5 $5 + 1
  924.             StrCpy $6 $4 $5
  925.  
  926.             StrCmp${_TEXTFUNC_S} $2 '' change
  927.             StrCmp${_TEXTFUNC_S} $6 '$1$2' 0 change
  928.             StrCpy $0 SAME
  929.             goto close
  930.  
  931.             change:
  932.             FileSeek $3 0 CUR $5
  933.             StrLen $4 $4
  934.             IntOp $4 $5 - $4
  935.             FileSeek $3 0 END $6
  936.             IntOp $6 $6 - $5
  937.  
  938.             System::Alloc /NOUNLOAD $6
  939.             Pop $0
  940.             FileSeek $3 $5 SET
  941.             System::Call /NOUNLOAD 'kernel32::ReadFile(i r3, i r0, i $6, t.,)'
  942.             FileSeek $3 $4 SET
  943.             StrCmp${_TEXTFUNC_S} $2 '' +2
  944.             FileWrite $3 '$1$2$\r$\n'
  945.             System::Call /NOUNLOAD 'kernel32::WriteFile(i r3, i r0, i $6, t.,)'
  946.             System::Call /NOUNLOAD 'kernel32::SetEndOfFile(i r3)'
  947.             System::Free $0
  948.             StrCmp${_TEXTFUNC_S} $2 '' +3
  949.             StrCpy $0 CHANGED
  950.             goto close
  951.             StrCpy $0 DELETED
  952.             goto close
  953.  
  954.             add:
  955.             StrCmp${_TEXTFUNC_S} $2 '' 0 +3
  956.             StrCpy $0 SAME
  957.             goto close
  958.             FileSeek $3 -1 END
  959.             FileRead $3 $4
  960.             IfErrors +4
  961.             StrCmp${_TEXTFUNC_S} $4 '$\r' +3
  962.             StrCmp${_TEXTFUNC_S} $4 '$\n' +2
  963.             FileWrite $3 '$\r$\n'
  964.             FileWrite $3 '$1$2$\r$\n'
  965.             StrCpy $0 ADDED
  966.  
  967.             close:
  968.             FileClose $3
  969.             goto end
  970.  
  971.             error:
  972.             SetErrors
  973.             StrCpy $0 ''
  974.  
  975.             end:
  976.             Pop $6
  977.             Pop $5
  978.             Pop $4
  979.             Pop $3
  980.             Pop $2
  981.             Pop $1
  982.             Exch $0
  983.         FunctionEnd
  984.  
  985.         !verbose pop
  986.     !endif
  987. !macroend
  988.  
  989. !macro FileRecode
  990.     !ifndef ${_TEXTFUNC_UN}FileRecode
  991.         !verbose push
  992.         !verbose ${_TEXTFUNC_VERBOSE}
  993.         !define ${_TEXTFUNC_UN}FileRecode `!insertmacro ${_TEXTFUNC_UN}FileRecodeCall`
  994.  
  995.         Function ${_TEXTFUNC_UN}FileRecode
  996.             Exch $1
  997.             Exch
  998.             Exch $0
  999.             Exch
  1000.             Push $2
  1001.             Push $3
  1002.             Push $4
  1003.  
  1004.             IfFileExists $0 0 error
  1005.             StrCmp $1 OemToChar +2
  1006.             StrCmp $1 CharToOem 0 error
  1007.  
  1008.             FileOpen $2 $0 a
  1009.             FileSeek $2 0 END $3
  1010.             System::Alloc /NOUNLOAD $3
  1011.             Pop $4
  1012.             FileSeek $2 0 SET
  1013.             System::Call /NOUNLOAD 'kernel32::ReadFile(i r2, i r4, i $3, t.,)'
  1014.             System::Call /NOUNLOAD 'user32::$1Buff(i r4, i r4, i $3)'
  1015.             FileSeek $2 0 SET
  1016.             System::Call /NOUNLOAD 'kernel32::WriteFile(i r2, i r4, i $3, t.,)'
  1017.             System::Free $4
  1018.             FileClose $2
  1019.             goto end
  1020.  
  1021.             error:
  1022.             SetErrors
  1023.  
  1024.             end:
  1025.             Pop $4
  1026.             Pop $3
  1027.             Pop $2
  1028.             Pop $1
  1029.             Pop $0
  1030.         FunctionEnd
  1031.  
  1032.         !verbose pop
  1033.     !endif
  1034. !macroend
  1035.  
  1036. !macro TrimNewLines
  1037.     !ifndef ${_TEXTFUNC_UN}TrimNewLines
  1038.         !verbose push
  1039.         !verbose ${_TEXTFUNC_VERBOSE}
  1040.         !define ${_TEXTFUNC_UN}TrimNewLines `!insertmacro ${_TEXTFUNC_UN}TrimNewLinesCall`
  1041.  
  1042.         Function ${_TEXTFUNC_UN}TrimNewLines
  1043.             Exch $0
  1044.             Push $1
  1045.             Push $2
  1046.  
  1047.             StrCpy $1 0
  1048.             IntOp $1 $1 - 1
  1049.             StrCpy $2 $0 1 $1
  1050.             StrCmp $2 '$\r' -2
  1051.             StrCmp $2 '$\n' -3
  1052.             StrCmp $1 -1 +3
  1053.             IntOp $1 $1 + 1
  1054.             StrCpy $0 $0 $1
  1055.  
  1056.             Pop $2
  1057.             Pop $1
  1058.             Exch $0
  1059.         FunctionEnd
  1060.  
  1061.         !verbose pop
  1062.     !endif
  1063. !macroend
  1064.  
  1065.  
  1066. # Uninstall. Case insensitive. #
  1067.  
  1068. !macro un.LineFindCall _INPUT _OUTPUT _RANGE _FUNC
  1069.     !verbose push
  1070.     !verbose ${_TEXTFUNC_VERBOSE}
  1071.     Push $0
  1072.     Push `${_INPUT}`
  1073.     Push `${_OUTPUT}`
  1074.     Push `${_RANGE}`
  1075.     GetFunctionAddress $0 `${_FUNC}`
  1076.     Push `$0`
  1077.     Call un.LineFind
  1078.     Pop $0
  1079.     !verbose pop
  1080. !macroend
  1081.  
  1082. !macro un.LineReadCall _FILE _NUMBER _RESULT
  1083.     !verbose push
  1084.     !verbose ${_TEXTFUNC_VERBOSE}
  1085.     Push `${_FILE}`
  1086.     Push `${_NUMBER}`
  1087.     Call un.LineRead
  1088.     Pop ${_RESULT}
  1089.     !verbose pop
  1090. !macroend
  1091.  
  1092. !macro un.FileReadFromEndCall _FILE _FUNC
  1093.     !verbose push
  1094.     !verbose ${_TEXTFUNC_VERBOSE}
  1095.     Push $0
  1096.     Push `${_FILE}`
  1097.     GetFunctionAddress $0 `${_FUNC}`
  1098.     Push `$0`
  1099.     Call un.FileReadFromEnd
  1100.     Pop $0
  1101.     !verbose pop
  1102. !macroend
  1103.  
  1104. !macro un.LineSumCall _FILE _RESULT
  1105.     !verbose push
  1106.     !verbose ${_TEXTFUNC_VERBOSE}
  1107.     Push `${_FILE}`
  1108.     Call un.LineSum
  1109.     Pop ${_RESULT}
  1110.     !verbose pop
  1111. !macroend
  1112.  
  1113. !macro un.FileJoinCall _FILE1 _FILE2 _FILE3
  1114.     !verbose push
  1115.     !verbose ${_TEXTFUNC_VERBOSE}
  1116.     Push `${_FILE1}`
  1117.     Push `${_FILE2}`
  1118.     Push `${_FILE3}`
  1119.     Call un.FileJoin
  1120.     !verbose pop
  1121. !macroend
  1122.  
  1123. !macro un.TextCompareCall _FILE1 _FILE2 _OPTION _FUNC
  1124.     !verbose push
  1125.     !verbose ${_TEXTFUNC_VERBOSE}
  1126.     Push $0
  1127.     Push `${_FILE1}`
  1128.     Push `${_FILE2}`
  1129.     Push `${_OPTION}`
  1130.     GetFunctionAddress $0 `${_FUNC}`
  1131.     Push `$0`
  1132.     Call un.TextCompare
  1133.     Pop $0
  1134.     !verbose pop
  1135. !macroend
  1136.  
  1137. !macro un.ConfigReadCall _FILE _ENTRY _RESULT
  1138.     !verbose push
  1139.     !verbose ${_TEXTFUNC_VERBOSE}
  1140.     Push `${_FILE}`
  1141.     Push `${_ENTRY}`
  1142.     Call un.ConfigRead
  1143.     Pop ${_RESULT}
  1144.     !verbose pop
  1145. !macroend
  1146.  
  1147. !macro un.ConfigWriteCall _FILE _ENTRY _VALUE _RESULT
  1148.     !verbose push
  1149.     !verbose ${_TEXTFUNC_VERBOSE}
  1150.     Push `${_FILE}`
  1151.     Push `${_ENTRY}`
  1152.     Push `${_VALUE}`
  1153.     Call un.ConfigWrite
  1154.     Pop ${_RESULT}
  1155.     !verbose pop
  1156. !macroend
  1157.  
  1158. !macro un.FileRecodeCall _FILE _FORMAT
  1159.     !verbose push
  1160.     !verbose ${_TEXTFUNC_VERBOSE}
  1161.     Push `${_FILE}`
  1162.     Push `${_FORMAT}`
  1163.     Call un.FileRecode
  1164.     !verbose pop
  1165. !macroend
  1166.  
  1167. !macro un.TrimNewLinesCall _FILE _RESULT
  1168.     !verbose push
  1169.     !verbose ${_TEXTFUNC_VERBOSE}
  1170.     Push `${_FILE}`
  1171.     Call un.TrimNewLines
  1172.     Pop ${_RESULT}
  1173.     !verbose pop
  1174. !macroend
  1175.  
  1176. !macro un.LineFind
  1177.     !ifndef un.LineFind
  1178.         !verbose push
  1179.         !verbose ${_TEXTFUNC_VERBOSE}
  1180.         !undef _TEXTFUNC_UN
  1181.         !define _TEXTFUNC_UN `un.`
  1182.  
  1183.         !insertmacro LineFind
  1184.  
  1185.         !undef _TEXTFUNC_UN
  1186.         !define _TEXTFUNC_UN
  1187.         !verbose pop
  1188.     !endif
  1189. !macroend
  1190.  
  1191. !macro un.LineRead
  1192.     !ifndef un.LineRead
  1193.         !verbose push
  1194.         !verbose ${_TEXTFUNC_VERBOSE}
  1195.         !undef _TEXTFUNC_UN
  1196.         !define _TEXTFUNC_UN `un.`
  1197.  
  1198.         !insertmacro LineRead
  1199.  
  1200.         !undef _TEXTFUNC_UN
  1201.         !define _TEXTFUNC_UN
  1202.         !verbose pop
  1203.     !endif
  1204. !macroend
  1205.  
  1206. !macro un.FileReadFromEnd
  1207.     !ifndef un.FileReadFromEnd
  1208.         !verbose push
  1209.         !verbose ${_TEXTFUNC_VERBOSE}
  1210.         !undef _TEXTFUNC_UN
  1211.         !define _TEXTFUNC_UN `un.`
  1212.  
  1213.         !insertmacro FileReadFromEnd
  1214.  
  1215.         !undef _TEXTFUNC_UN
  1216.         !define _TEXTFUNC_UN
  1217.         !verbose pop
  1218.     !endif
  1219. !macroend
  1220.  
  1221. !macro un.LineSum
  1222.     !ifndef un.LineSum
  1223.         !verbose push
  1224.         !verbose ${_TEXTFUNC_VERBOSE}
  1225.         !undef _TEXTFUNC_UN
  1226.         !define _TEXTFUNC_UN `un.`
  1227.  
  1228.         !insertmacro LineSum
  1229.  
  1230.         !undef _TEXTFUNC_UN
  1231.         !define _TEXTFUNC_UN
  1232.         !verbose pop
  1233.     !endif
  1234. !macroend
  1235.  
  1236. !macro un.FileJoin
  1237.     !ifndef un.FileJoin
  1238.         !verbose push
  1239.         !verbose ${_TEXTFUNC_VERBOSE}
  1240.         !undef _TEXTFUNC_UN
  1241.         !define _TEXTFUNC_UN `un.`
  1242.  
  1243.         !insertmacro FileJoin
  1244.  
  1245.         !undef _TEXTFUNC_UN
  1246.         !define _TEXTFUNC_UN
  1247.         !verbose pop
  1248.     !endif
  1249. !macroend
  1250.  
  1251. !macro un.TextCompare
  1252.     !ifndef un.TextCompare
  1253.         !verbose push
  1254.         !verbose ${_TEXTFUNC_VERBOSE}
  1255.         !undef _TEXTFUNC_UN
  1256.         !define _TEXTFUNC_UN `un.`
  1257.  
  1258.         !insertmacro TextCompare
  1259.  
  1260.         !undef _TEXTFUNC_UN
  1261.         !define _TEXTFUNC_UN
  1262.         !verbose pop
  1263.     !endif
  1264. !macroend
  1265.  
  1266. !macro un.ConfigRead
  1267.     !ifndef un.ConfigRead
  1268.         !verbose push
  1269.         !verbose ${_TEXTFUNC_VERBOSE}
  1270.         !undef _TEXTFUNC_UN
  1271.         !define _TEXTFUNC_UN `un.`
  1272.  
  1273.         !insertmacro ConfigRead
  1274.  
  1275.         !undef _TEXTFUNC_UN
  1276.         !define _TEXTFUNC_UN
  1277.         !verbose pop
  1278.     !endif
  1279. !macroend
  1280.  
  1281. !macro un.ConfigWrite
  1282.     !ifndef un.ConfigWrite
  1283.         !verbose push
  1284.         !verbose ${_TEXTFUNC_VERBOSE}
  1285.         !undef _TEXTFUNC_UN
  1286.         !define _TEXTFUNC_UN `un.`
  1287.  
  1288.         !insertmacro ConfigWrite
  1289.  
  1290.         !undef _TEXTFUNC_UN
  1291.         !define _TEXTFUNC_UN
  1292.         !verbose pop
  1293.     !endif
  1294. !macroend
  1295.  
  1296. !macro un.FileRecode
  1297.     !ifndef un.FileRecode
  1298.         !verbose push
  1299.         !verbose ${_TEXTFUNC_VERBOSE}
  1300.         !undef _TEXTFUNC_UN
  1301.         !define _TEXTFUNC_UN `un.`
  1302.  
  1303.         !insertmacro FileRecode
  1304.  
  1305.         !undef _TEXTFUNC_UN
  1306.         !define _TEXTFUNC_UN
  1307.         !verbose pop
  1308.     !endif
  1309. !macroend
  1310.  
  1311. !macro un.TrimNewLines
  1312.     !ifndef un.TrimNewLines
  1313.         !verbose push
  1314.         !verbose ${_TEXTFUNC_VERBOSE}
  1315.         !undef _TEXTFUNC_UN
  1316.         !define _TEXTFUNC_UN `un.`
  1317.  
  1318.         !insertmacro TrimNewLines
  1319.  
  1320.         !undef _TEXTFUNC_UN
  1321.         !define _TEXTFUNC_UN
  1322.         !verbose pop
  1323.     !endif
  1324. !macroend
  1325.  
  1326.  
  1327. # Install. Case sensitive. #
  1328.  
  1329. !macro TextCompareSCall _FILE1 _FILE2 _OPTION _FUNC
  1330.     !verbose push
  1331.     !verbose ${_TEXTFUNC_VERBOSE}
  1332.     Push $0
  1333.     Push `${_FILE1}`
  1334.     Push `${_FILE2}`
  1335.     Push `${_OPTION}`
  1336.     GetFunctionAddress $0 `${_FUNC}`
  1337.     Push `$0`
  1338.     Call TextCompareS
  1339.     Pop $0
  1340.     !verbose pop
  1341. !macroend
  1342.  
  1343. !macro ConfigReadSCall _FILE _ENTRY _RESULT
  1344.     !verbose push
  1345.     !verbose ${_TEXTFUNC_VERBOSE}
  1346.     Push `${_FILE}`
  1347.     Push `${_ENTRY}`
  1348.     Call ConfigReadS
  1349.     Pop ${_RESULT}
  1350.     !verbose pop
  1351. !macroend
  1352.  
  1353. !macro ConfigWriteSCall _FILE _ENTRY _VALUE _RESULT
  1354.     !verbose push
  1355.     !verbose ${_TEXTFUNC_VERBOSE}
  1356.     Push `${_FILE}`
  1357.     Push `${_ENTRY}`
  1358.     Push `${_VALUE}`
  1359.     Call ConfigWriteS
  1360.     Pop ${_RESULT}
  1361.     !verbose pop
  1362. !macroend
  1363.  
  1364. !macro TextCompareS
  1365.     !ifndef TextCompareS
  1366.         !verbose push
  1367.         !verbose ${_TEXTFUNC_VERBOSE}
  1368.         !undef _TEXTFUNC_S
  1369.         !define _TEXTFUNC_S `S`
  1370.  
  1371.         !insertmacro TextCompare
  1372.  
  1373.         !undef _TEXTFUNC_S
  1374.         !define _TEXTFUNC_S
  1375.         !verbose pop
  1376.     !endif
  1377. !macroend
  1378.  
  1379. !macro ConfigReadS
  1380.     !ifndef ConfigReadS
  1381.         !verbose push
  1382.         !verbose ${_TEXTFUNC_VERBOSE}
  1383.         !undef _TEXTFUNC_S
  1384.         !define _TEXTFUNC_S `S`
  1385.  
  1386.         !insertmacro ConfigRead
  1387.  
  1388.         !undef _TEXTFUNC_S
  1389.         !define _TEXTFUNC_S
  1390.         !verbose pop
  1391.     !endif
  1392. !macroend
  1393.  
  1394. !macro ConfigWriteS
  1395.     !ifndef ConfigWriteS
  1396.         !verbose push
  1397.         !verbose ${_TEXTFUNC_VERBOSE}
  1398.         !undef _TEXTFUNC_S
  1399.         !define _TEXTFUNC_S `S`
  1400.  
  1401.         !insertmacro ConfigWrite
  1402.  
  1403.         !undef _TEXTFUNC_S
  1404.         !define _TEXTFUNC_S
  1405.         !verbose pop
  1406.     !endif
  1407. !macroend
  1408.  
  1409.  
  1410. # Uninstall. Case sensitive. #
  1411.  
  1412. !macro un.TextCompareSCall _FILE1 _FILE2 _OPTION _FUNC
  1413.     !verbose push
  1414.     !verbose ${_TEXTFUNC_VERBOSE}
  1415.     Push $0
  1416.     Push `${_FILE1}`
  1417.     Push `${_FILE2}`
  1418.     Push `${_OPTION}`
  1419.     GetFunctionAddress $0 `${_FUNC}`
  1420.     Push `$0`
  1421.     Call un.TextCompareS
  1422.     Pop $0
  1423.     !verbose pop
  1424. !macroend
  1425.  
  1426. !macro un.ConfigReadSCall _FILE _ENTRY _RESULT
  1427.     !verbose push
  1428.     !verbose ${_TEXTFUNC_VERBOSE}
  1429.     Push `${_FILE}`
  1430.     Push `${_ENTRY}`
  1431.     Call un.ConfigReadS
  1432.     Pop ${_RESULT}
  1433.     !verbose pop
  1434. !macroend
  1435.  
  1436. !macro un.ConfigWriteSCall _FILE _ENTRY _VALUE _RESULT
  1437.     !verbose push
  1438.     !verbose ${_TEXTFUNC_VERBOSE}
  1439.     Push `${_FILE}`
  1440.     Push `${_ENTRY}`
  1441.     Push `${_VALUE}`
  1442.     Call un.ConfigWriteS
  1443.     Pop ${_RESULT}
  1444.     !verbose pop
  1445. !macroend
  1446.  
  1447. !macro un.TextCompareS
  1448.     !ifndef un.TextCompareS
  1449.         !verbose push
  1450.         !verbose ${_TEXTFUNC_VERBOSE}
  1451.         !undef _TEXTFUNC_UN
  1452.         !define _TEXTFUNC_UN `un.`
  1453.         !undef _TEXTFUNC_S
  1454.         !define _TEXTFUNC_S `S`
  1455.  
  1456.         !insertmacro TextCompare
  1457.  
  1458.         !undef _TEXTFUNC_UN
  1459.         !define _TEXTFUNC_UN
  1460.         !undef _TEXTFUNC_S
  1461.         !define _TEXTFUNC_S
  1462.         !verbose pop
  1463.     !endif
  1464. !macroend
  1465.  
  1466. !macro un.ConfigReadS
  1467.     !ifndef un.ConfigReadS
  1468.         !verbose push
  1469.         !verbose ${_TEXTFUNC_VERBOSE}
  1470.         !undef _TEXTFUNC_UN
  1471.         !define _TEXTFUNC_UN `un.`
  1472.         !undef _TEXTFUNC_S
  1473.         !define _TEXTFUNC_S `S`
  1474.  
  1475.         !insertmacro ConfigRead
  1476.  
  1477.         !undef _TEXTFUNC_UN
  1478.         !define _TEXTFUNC_UN
  1479.         !undef _TEXTFUNC_S
  1480.         !define _TEXTFUNC_S
  1481.         !verbose pop
  1482.     !endif
  1483. !macroend
  1484.  
  1485. !macro un.ConfigWriteS
  1486.     !ifndef un.ConfigWriteS
  1487.         !verbose push
  1488.         !verbose ${_TEXTFUNC_VERBOSE}
  1489.         !undef _TEXTFUNC_UN
  1490.         !define _TEXTFUNC_UN `un.`
  1491.         !undef _TEXTFUNC_S
  1492.         !define _TEXTFUNC_S `S`
  1493.  
  1494.         !insertmacro ConfigWrite
  1495.  
  1496.         !undef _TEXTFUNC_UN
  1497.         !define _TEXTFUNC_UN
  1498.         !undef _TEXTFUNC_S
  1499.         !define _TEXTFUNC_S
  1500.         !verbose pop
  1501.     !endif
  1502. !macroend
  1503.  
  1504. !endif
  1505.